package com.pesilo.module.watch.mvc.view
{
	import com.pesilo.module.watch.mvc.controller.ApplicationFacade;
	import com.pesilo.module.watch.mvc.model.vo.WatchVO;
	import com.pesilo.module.watch.mvc.view.component.WatchComponent;
	
	import org.puremvc.as3.multicore.interfaces.IMediator;
	import org.puremvc.as3.multicore.interfaces.INotification;
	import org.puremvc.as3.multicore.patterns.mediator.Mediator;

	public class WatchMediator extends Mediator implements IMediator
	{
		public static const NAME:String="WatchMediator";
		public function WatchMediator(viewComponent:Object)
		{
			super(NAME,viewComponent);
		}
		
		override public function listNotificationInterests():Array{
			return[
				ApplicationFacade.EVENT_WATCH_DATA_APP
			]
		}
		
		override public function handleNotification(notification:INotification):void{
			var data:Object=notification.getBody();
			
			switch(notification.getName()){
				case ApplicationFacade.EVENT_WATCH_DATA_APP:
					view.photo(data as WatchVO);
					break;
			}
		}
		
		protected function get view():WatchComponent{
			return viewComponent as WatchComponent;
		}
	}
}